<?php include"shared/head.php";
include"shared/log.php";?>



<?php
//include "shared/moudles.php";
$tid=$_GET['tid'];
$tsc=$_GET['tsc'];
$ttg=$_GET['ttg'];
?>

<form action="" method="POST">
    <table>
        <tr>
        <input type="hidden" name="edit_id" value="<?php echo $tid; ?>">
            <?php echo $edit_source_label; ?><input type="text" name="edit_source" value="<?php echo $tsc; ?>">
        </tr>
        <tr>
            <?php echo $edit_target_label; ?><input type="text" name="edit_target" value="<?php echo $ttg; ?>">
        </tr>
        <tr>
        <button type="submit"><?php echo $submit_newterm; ?></button>
        </tr>
    </table>

</form>

<?php
$edit_source=$_POST["edit_source"];
$edit_target=$_POST["edit_target"];
$edit_id=$_POST["edit_id"];
include "shared/conn.php";
mysqli_select_db( $conn,"personalterm");
mysqli_query($conn, "set names 'utf-8");

$sql_edit="UPDATE `term` SET `zh_CN`={$edit_source} ,`en_US`={$edit_target} WHERE `id`={$edit_id}  ";
$result=mysqli_query($conn, $sql_edit);
if (!$result)
{
    echo "数据编辑插入数据库出错！";
    echo "插入出错测试";
}
else{
    echo "<script>alert('编辑成功!')</script>";
    echo "<script>location='index.php'</script>";
}
?>


 <?php include"shared/foot.php";?>
